/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.appleframework.web.results;

import org.appleframework.web.HttpRequest;
import org.appleframework.web.HttpResponse;

/**
 *
 * @author zhujg
 */
public abstract class Result extends RuntimeException {

  public Result() {
  }

  public Result(String description) {
    super(description);
  }

  public abstract void apply(HttpRequest request, HttpResponse response);

  protected void setContentTypeIfNotSet(HttpResponse response, String contentType) {
    if (response.contentType == null) {
      response.contentType = contentType;
    }
  }
}
